package com.androidgame.framework.testgame;

import com.androidgame.framework.Pixmap;
import com.androidgame.framework.Sound;
import com.androidgame.framework.Music;
import com.androidgame.framework.Screen;
import com.androidgame.framework.Game;
import com.androidgame.framework.Graphics;

//class derive from Screen again and implement an adequate constructor for it
public class MainMenuScreen extends Screen 
{
    Music music1;
    Sound sound1;
    Pixmap image1;
    int x;
    int y;
    
	public MainMenuScreen(Game game) 
	{
		super(game);
                
                image1 = game.getGraphics().newPixmap("GorillaSpriteSheet.png", Graphics.PixmapFormat.RGB565);
                
                music1 = game.getAudio().newMusic("delayscape_planet.ogg");
                
                sound1 = game.getAudio().newSound("click.ogg");
                
                  x = 0;
                  y = 0;
	}
	
	//checks for button presses and reacts accordingly
	public void update(float deltaTime) 
	{
	
             //change to red
           // canvas.drawRGB(255, 0, 0);
            
            //set to red
            game.getGraphics().clear(0xff0000);
            
	}
	
	//render our main menu screen
	public void present(float deltaTime) 
	{
            if(!music1.isPlaying())
             music1.play();

            if(x > game.getGraphics().getWidth())
            {
                x = 0;
                //sound1.play(1.0f);
            }
            
            x += 150;
            y += 10;
            game.getGraphics().drawPixmap(image1, 10, 10,x -150 ,20,150,120);
	}

	public void pause() 
	{
		
	}

	public void resume() 
	{
         
	}

	public void dispose() 
	{
            music1.dispose();
	}
}